﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Base.Types {

    public class TimeObject {

        #region Members

        private int bHour;
        private int bMinute;

        #endregion

        #region Construction

        public TimeObject() {
            this.bHour = DateTime.Now.Hour;
            this.bMinute = DateTime.Now.Minute;
        }

        public TimeObject(int stunde, int minute) {
            this.bHour = stunde;
            this.bMinute = minute;
        }

        #endregion

        #region Properties

        public int Hour {
            get { return this.bHour; }
            set { this.bHour = value; }
        }

        public int Minute {
            get { return this.bMinute; }
            set { this.bMinute = value; }
        }

        public double value {
            get {
                return Convert.ToDouble(this.Hour + (this.Minute != 0 ? this.Minute / 60.0 : 0));
            }
        }

        #endregion

        #region Overrides

        public override string ToString() {
            return this.bHour.ToString() + ":" + this.bMinute.ToString();
        }

        #endregion

    }
}
